#ifndef __HEMUOp_H__
#define __HEMUOp_H__

#include"HEMUIRCode.h"

/*
 *template for cmp
 */
template <typename T>
HEMUIRVar cmp_op(const T& a, const T& b, CMPCond cond) {
	HEMUIRVar var;
	var.btype = HEMUIRBtype::I8;
	if (cond == CMPCond::EQ)
		var.val.i8_val = (a == b);
	else if (cond == CMPCond::NE)
		var.val.i8_val = (a != b);
	else if (cond == CMPCond::GT)
		var.val.i8_val = (a > b);
	else if (cond == CMPCond::GE)
		var.val.i8_val = (a >= b);
	else if (cond == CMPCond::LT)
		var.val.i8_val = (a < b);
	else
		var.val.i8_val = (a <= b);
	return var;
}

template <typename T>
T fneg_op(const T& a) {
	return -a;
}













#endif

